package com.lgw.first.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

/**
 * StartupListener
 *
 * @author 廖功旺
 * @version 1.0
 * @since 2024/11/6 16:13
 */
@Slf4j
@Component
public class StartupListener implements ApplicationListener<ContextRefreshedEvent> {

    @Value("${spring.application.name}")
    private String applicationName;

    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        log.info("{} 服务启动成功", applicationName);
    }
}
